package com.yjd.bi.jf.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.yjd.bi.jf.dao.IJfIntegralYearDao;
import com.yjd.bi.jf.enums.JfIntegralDataIncrEnum;
import com.yjd.bi.jf.enums.JfIntegralDataRefTableEnum;
import com.yjd.bi.jf.enums.JfIntegralDataType;
import com.yjd.bi.jf.model.JfIntegralDataModel;
import com.yjd.bi.jf.model.JfIntegralModel;
import com.yjd.bi.jf.model.JfIntegralYearModel;
import com.yjd.bi.jf.service.IJfIntegralDataService;
import com.yjd.bi.jf.service.IJfIntegralService;
import com.yjd.bi.jf.service.IJfIntegralYearService;
import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.enums.DbWREnums;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.enums.UserEnums.Channel;
import com.yjd.comm.util.FrameUtil;

/**
 * <b>description</b>：会员年积分流水表业务实现<br>
 * <b>time</b>：2017-03-07 15:11:11 <br>
 * <b>author</b>：  ready percy-chen@hotmail.com
 */
@Service("jfIntegralYearService")
public class JfIntegralYearServiceImpl extends BaseServiceImpl implements IJfIntegralYearService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public JfIntegralYearModel insert(JfIntegralYearModel model) throws Exception {
		return this.jfIntegralYearDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(JfIntegralYearModel model) throws Exception {
		return this.jfIntegralYearDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.jfIntegralYearDao.deleteModel(paramMap, true);
	}

	
	
	@Override
	public int updateMap(Map<Object, Object> map) throws Exception {
	    return jfIntegralYearDao.updateByMap(map, true);
	}


	

	@SuppressWarnings("unchecked")
	@Override
        public void clearJfOfYear(Long id) throws Exception {
        	
        }
    

	

	@Resource
	private IJfIntegralYearDao jfIntegralYearDao;
	@Resource
	private IJfIntegralService jfIntegralService;
	@Resource
	private IJfIntegralDataService jfIntegralDataService;

	@Override
	public IBaseDao getBaseDao() {
		return this.jfIntegralYearDao;
	}

}
